﻿<local:DocumentBase x:Class="WPFExcelReport.QFTMCO"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:dbc="clr-namespace:QFTMCO"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:my="clr-namespace:WPFExcelReport"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    Title="报价成本"  
                    FontSize="14"
                    Background="WhiteSmoke"
                    MaxWidth="1400"
                    MinWidth="1200"
                    Name="mainw"     
                    Margin="0,0,0,0"  >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <db:SETINTEXDB x:Key="SetData" />
        <CollectionViewSource  x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwKAAUF" Source="{Binding Path=KAAUF,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwKAVERF" Source="{Binding Path=KAVERF,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwWAFARBEN" Source="{Binding Path=WAFARBEN,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwWASTAMM" Source="{Binding Path=WASTAMM,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwBASTGA" Source="{Binding Path=BASTGA,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwWASTGA" Source="{Binding Path=WASTGA,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwBASTKE" Source="{Binding Path=BASTKE,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwBSSATZ" Source="{Binding Path=BSSATZ,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwWASTKE" Source="{Binding Path=WASTKE,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwWTGEW" Source="{Binding Path=WTGEW,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwAPZUORD" Source="{Binding Path=APAPZUORD,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwQUPROCESS" Source="{Binding Path=QUPROCESS,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwQUTMASTER" Source="{Binding Path=QUTMASTER,Source={StaticResource SetData}}"/>
        <CollectionViewSource  x:Key="vwWDECK"/>
        <CollectionViewSource  x:Key="vwVAPRICE"/>
        <CollectionViewSource  x:Key="vwVAMAT"/>
        <CollectionViewSource  x:Key="vwVAPROC"/>
        <CollectionViewSource  x:Key="vwEXVAPROC"/>
        <CollectionViewSource  x:Key="vwWPPRICE"/>
        <CollectionViewSource  x:Key="vwWPMAT"/>
        <CollectionViewSource  x:Key="vwWPPROC"/>
        <CollectionViewSource  x:Key="vwEXWPPROC"/>
        <CollectionViewSource  x:Key="vwWFPRICE"/>
        <CollectionViewSource  x:Key="vwWFMAT"/>
        <CollectionViewSource  x:Key="vwWFPROC"/>
        <CollectionViewSource  x:Key="vwEXWFPROC"/>
        <CollectionViewSource  x:Key="vwGS03PRICE"/>
        <CollectionViewSource  x:Key="vwWAART"/>
        <CollectionViewSource  x:Key="vwWAVAR"/>
        <CollectionViewSource  x:Key="vwWACOLOR"/>
        <CollectionViewSource  x:Key="vwWAFINISH"/>
        <CollectionViewSource  x:Key="vwRYARNPRICE"/>
        <CollectionViewSource x:Key="vwPROCSUPP"/>
        <CollectionViewSource x:Key="vwYARNPRICE" Source="{Binding Path=YARNPRICE, Source={StaticResource SetData}}" />
        <CollectionViewSource x:Key="vwPRODCOST" Source="{Binding Path=PRODCOST, Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"  Grid.RowSpan="3">
            <TextBlock  FontSize="18" >销售单</TextBlock>
            <WrapPanel>
                <TextBox Name="txtKRS"   FontSize="18" Width="40"   Background="Wheat"  MinWidth="40" />
                <TextBox Name="txtLFD"   FontSize="18"  Width="140"   Background="Green"  MinWidth="100" />
                <StackPanel Margin="10,0,0,0" >
                    <Button    Height="23"  Margin="10,0,0,0" Name="btnQuery" Width="23" Click="btnQuery_Click" >
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Find.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock FontSize="18" >查询</TextBlock>
                </StackPanel>
                <StackPanel Margin="10,0,0,0" >
                    <TextBox FontSize="18"  Width="80" Background="White" Height="Auto" VerticalAlignment="Top" Name="txtQQuantity" Text="1" ></TextBox>
                    <TextBlock FontSize="18"  Margin="10,0,0,0">数量kg</TextBlock>
                </StackPanel>
                <StackPanel Margin="10,0,0,0" >
                    <TextBox  FontSize="18" Margin="0,0,0,0" Width="40" Height="Auto" Background="White" VerticalAlignment="Top" Name="txtFNRatio" Text="0.95" ></TextBox>
                    <TextBlock  FontSize="18" Margin="0,0,0,0">合格率</TextBlock>
                </StackPanel>
                <StackPanel Margin="10,0,0,0" >
                        <Button    Height="23"  Margin="10,0,0,0"  Name="btnCompute" Width="23" Click="btnQuNew_Click" >
                            <Button.Background>
                                <ImageBrush ImageSource="/IntexReportClient;component/Images/Add.png" />
                            </Button.Background>
                        </Button>
                    <TextBlock  FontSize="18" >成本</TextBlock>
                    </StackPanel>
                    <StackPanel Margin="20,0,0,0" >
                        <Button  Margin="10,0,0,0"  Height="23" Name="btnPrint" Width="23" Click="btnPrint_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="/IntexReportClient;component/Images/Print.png" />
                            </Button.Background>
                        </Button>
                    <TextBlock FontSize="18" >打印</TextBlock>
                    </StackPanel>
            </WrapPanel>
            <WrapPanel>
                <DataGrid 
                                AutoGenerateColumns="False"
                                Height="Auto"
                                HorizontalAlignment="Left" 
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPOS}}" 
                                MaxHeight="{Binding Path=Width, ElementName=row21}"
                                MaxWidth="{Binding Path=Width, ElementName=colum21}"
                    SelectionChanged="dgVKPOS_SelectionChanged"
                                Margin="0,0,0,0" 
                                Name="dgVKPOS" 
                    MinHeight="100"
                                RowDetailsVisibilityMode="VisibleWhenSelected"
                                VerticalAlignment="Top" >
                    <DataGrid.Columns>
                        <DataGridTextColumn  Binding="{Binding Path=VKPAUFPOS}" Header="行" Width="SizeToHeader" />
                        <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="品种" Width="100" />
                        <DataGridTextColumn   Binding="{Binding Path=VKPFARBE}" Header="色号" Width="40" />
                        <DataGridTextColumn   Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="数量" Width="60" /> 
                    </DataGrid.Columns>
                </DataGrid>
                <StackPanel>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1*"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60"></ColumnDefinition>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0">品种:</TextBlock>
                        <TextBox Grid.Row="0" Grid.Column="1" Name="txtQart" Text="{Binding WDART, Source={StaticResource ResourceKey=vwWDECK}}"   Width="140"   Background="Wheat"  MinWidth="100" />
                        <TextBlock Grid.Row="1" Grid.Column="0">var:</TextBlock>
                        <TextBox Grid.Row="1" Grid.Column="1" Name="txtQvar"   Text="{Binding WDVAR, Source={StaticResource ResourceKey=vwWDECK}}"  Width="140"   Background="Wheat"  MinWidth="100" />
                        <TextBlock Grid.Row="2" Grid.Column="0">色号:</TextBlock>
                        <TextBox Grid.Row="2" Grid.Column="1" Name="txtQColor"   Text="{Binding WDFARBE, Source={StaticResource ResourceKey=vwWDECK}}"  Width="140"           Background="Green" MinWidth="40"/>
                        <TextBlock Grid.Row="3" Grid.Column="0">印花:</TextBlock>
                        <TextBox Grid.Row="3" Grid.Column="1" Name="txtQDESS"   Text="{Binding WDDESS, Source={StaticResource ResourceKey=vwWDECK}}"  Width="140"           Background="Green" MinWidth="40"/>
                        <TextBox Grid.Row="4" Grid.Column="1" Name="txtQCOLORIT"   Text="{Binding WDCOLORIT, Source={StaticResource ResourceKey=vwWDECK}}"  Width="140"           Background="Green" MinWidth="40"/>
                        <TextBlock Grid.Row="5" Grid.Column="0">整理:</TextBlock>
                        <TextBox Grid.Row="5" Grid.Column="1" Name="txtQFinish" Text="{Binding WDBESCHICH, Source={StaticResource ResourceKey=vwWDECK}}"    Width="140"           Background="Pink" MinWidth="40"/>                         					
                    </Grid>    
                </StackPanel>
            </WrapPanel> 
                <WrapPanel>
                <WrapPanel Margin="0,0,0,0" IsEnabled="False" Visibility="Hidden" >
                    <TextBlock>品种起始:</TextBlock>
                    <TextBox Name="txtQART" Width="100"></TextBox>
                    <TextBlock >品种:</TextBlock>
                    <ComboBox Name="cmbWAART" 
                              IsEditable="True" 
                              IsTextSearchEnabled="True" 
                              Width="120"
                              Background="Wheat" 
                              MinWidth="100"
                              HorizontalAlignment="Left"   StaysOpenOnEdit="True" 
                              Text="{Binding Path=KAAART, Mode=TwoWay, Source={StaticResource ResourceKey=vwKAAUF}, Converter={StaticResource ResourceKey=gb2312}}" 
                              DisplayMemberPath="WAART" SelectedValuePath="WAART" 
                              ItemsSource="{Binding  Source={StaticResource ResourceKey=vwWAART}}" 
                              VerticalAlignment="Center" 
                              PreviewMouseLeftButtonDown="cmbWAART_PreviewMouseLeftButtonDown"
                              >
                    </ComboBox>
                    <ComboBox Name="cmbWAVAR"
                              IsEditable="True" 
                              IsTextSearchEnabled="True"
                              Width="60" 
                              Background="Wheat" 
                              MinWidth="40"
                              HorizontalAlignment="Left"  
                              StaysOpenOnEdit="True" 
                              Text="{Binding Path=KAAVAR, Mode=TwoWay, Source={StaticResource ResourceKey=vwKAAUF}, Converter={StaticResource ResourceKey=gb2312}}" 
                              DisplayMemberPath="WAVAR" 
                              SelectedValuePath="WAVAR" 
                              ItemsSource="{Binding  Source={StaticResource ResourceKey=vwWAVAR}}" 
                              VerticalAlignment="Center"   
                              PreviewMouseLeftButtonDown="cmbWAVAR_PreviewMouseLeftButtonDown"
                              >
                    </ComboBox>
                    <ComboBox Name="cmbWACOLOR"
                              IsEditable="True" 
                              IsTextSearchEnabled="True" 
                              Width="60" 
                              Background="Wheat" 
                              MinWidth="40" 
                              HorizontalAlignment="Left"   StaysOpenOnEdit="True" 
                              Text="{Binding Path=KAAFARBE, Mode=TwoWay, Source={StaticResource ResourceKey=vwKAAUF}, Converter={StaticResource ResourceKey=gb2312}}" 
                              DisplayMemberPath="WAFZUSATZ" 
                              SelectedValuePath="WAFZUSATZ" 
                              ItemsSource="{Binding  Source={StaticResource ResourceKey=vwWACOLOR}}" 
                              VerticalAlignment="Center"
                              PreviewMouseLeftButtonDown="cmbWACOLOR_PreviewMouseLeftButtonDown"
                              >
                    </ComboBox>
                    <ComboBox Name="cmbWAFINISH"
                              IsEditable="True" 
                              IsTextSearchEnabled="True"
                              Width="100" 
                              Background="Wheat" 
                              MinWidth="40" 
                              HorizontalAlignment="Left"   StaysOpenOnEdit="True" 
                              Text="{Binding Path=KAABESCHI, Mode=TwoWay, Source={StaticResource ResourceKey=vwKAAUF}, Converter={StaticResource ResourceKey=gb2312}}" 
                              DisplayMemberPath="WAFZUSATZ" 
                              SelectedValuePath="WAFZUSATZ" 
                              ItemsSource="{Binding  Source={StaticResource ResourceKey=vwWAFINISH}}" 
                              VerticalAlignment="Center"  
                              PreviewMouseLeftButtonDown="cmbWAFINISH_PreviewMouseLeftButtonDown"
                              >
                    </ComboBox>
                </WrapPanel> 
            </WrapPanel>
            <WrapPanel  DataContext="{Binding Source={StaticResource ResourceKey=vwWASTAMM}}">
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition  Width="1*" />
                    </Grid.ColumnDefinitions>
                    <WrapPanel  Grid.Column="0">
                    </WrapPanel >
                    <Label  Content="整理缩率:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <WrapPanel  Grid.Column="1">
                        <TextBox  Grid.Column="1" Text="{Binding Path=WALAEAEND, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="Auto" MinWidth="40" />
                        <TextBlock >%</TextBlock>
                    </WrapPanel>
                </Grid>
                <Grid Margin="0,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition   Width="1*" />
                        <ColumnDefinition   Width="1*" />
                    </Grid.ColumnDefinitions>
                    <Label Content="经密:" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox Grid.Column="1" Text="{Binding Path=WAFFDDIK, Mode=TwoWay, Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                </Grid>
                <Grid   Margin="0,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition   Width="1*" />
                        <ColumnDefinition   Width="1*" />
                    </Grid.ColumnDefinitions>
                    <Label Content="纬密:" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox Grid.Column="1" Text="{Binding Path=WAFFDDIS, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                </Grid>
                <TextBlock >(</TextBlock>
                <Label  Content="{Binding Path=WAFDDIM}" VerticalAlignment="Center" Width="40" Height="25" />
                <TextBlock >)</TextBlock>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition  Width="1*" />
                    </Grid.ColumnDefinitions>
                    <WrapPanel  Grid.Column="0">
                    </WrapPanel>
                    <WrapPanel  Grid.Column="1">
                    </WrapPanel>
                </Grid>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition  Width="1*" />
                    </Grid.ColumnDefinitions>
                    <WrapPanel  Grid.Column="0">
                    </WrapPanel>
                    <WrapPanel  Grid.Column="1">
                    </WrapPanel>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition  Width="1*" />
                    </Grid.ColumnDefinitions>
                    <WrapPanel   Grid.Column="0">
                    </WrapPanel>
                    <Label  Content="幅宽:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <WrapPanel   Grid.Column="1">
                        <TextBox  Grid.Column="1" Text="{Binding Path=WARWBRT, Mode=TwoWay,  Converter={StaticResource ResourceKey=d10}}" VerticalAlignment="Center" Width="Auto" MinWidth="60" />
                    </WrapPanel>
                </Grid>
           
            </WrapPanel>
            <Expander Header="原纱总价:"  Name="zoneRYarn">               
                <DataGrid 
                          ItemsSource="{Binding Source={StaticResource vwGS03PRICE}}" 
                          RowDetailsVisibilityMode="VisibleWhenSelected"
                          AutoGenerateColumns="False" 
                          Height="Auto" 
                          Width="Auto"
                          HorizontalScrollBarVisibility="Auto"
                          VerticalScrollBarVisibility="Auto" 
                       Tag="RYARNPRICE"
                    SelectionChanged="dlgMaster_SelectionChanged"
                        >
                    <DataGrid.Columns>
                        <DataGridTextColumn  Binding="{Binding Path=QUJW}" Header="J/W" Width="Auto" />
                        <DataGridTextColumn  Binding="{Binding Path=QUARTICLE}" Header="品种" Width="120" />
                        <DataGridTextColumn  Binding="{Binding Path=QUVAR}" Header="var" Width="30" />
                        <DataGridTextColumn  Binding="{Binding Path=QUCOLOR}" Header="色号" Width="80" />
                        <DataGridTextColumn  Binding="{Binding Path=QUSUPNAME}" Header="供应商" Width="80" />
                        <DataGridTextColumn  Binding="{Binding Path=QUCPRICE}" Header="当前价格" Width="80" />
                        <DataGridTextColumn  Binding="{Binding Path=QUPPRICE}" Header="将来价格" Width="80" />
                        <DataGridTextColumn  Binding="{Binding Path=QURATIO}" Header="系数" Width="60" />
                    </DataGrid.Columns>
                </DataGrid> 
            </Expander>
            <Expander Header="经纱成本:"  Name="zoneWPYarn">
                <DataGrid 
                    ItemsSource="{Binding Source={StaticResource vwWPPRICE}}" 
                    RowDetailsVisibilityMode="VisibleWhenSelected"
                    AutoGenerateColumns="False" 
                    Height="Auto" 
                    Width="Auto"
                    Name="dlgWPYARN"
                    HorizontalScrollBarVisibility="Auto"
                    VerticalScrollBarVisibility="Auto"  
                    Tag="VAPRICE"
                    SelectionChanged="dlgMaster_SelectionChanged" 
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn  Binding="{Binding Path=QUARTICLE}" Header="纱线" Width="120" />
                        <DataGridTextColumn  Binding="{Binding Path=QUVAR}" Header="var" Width="40" />
                        <DataGridTextColumn  Binding="{Binding Path=QUCOLOR}" Header="色号" Width="40" />
                        <DataGridTextColumn  Binding="{Binding Path=QUCPRICE}" Header="价格" Width="80" />
                        <DataGridTextColumn  Binding="{Binding Path=QPUOM}" Header="单位" Width="40" />
                        <DataGridTextColumn  Binding="{Binding Path=QUFQUANTITY}" Header="数量" Width="80" />
                        <DataGridTextColumn  Binding="{Binding Path=QUCVALUE}" Header="金额" Width="80" />
                        <DataGridTextColumn  Binding="{Binding Path=QUPRODCOST}" Header="加工成本" Width="80" />
                    </DataGrid.Columns>
                </DataGrid>
            </Expander>
            <Expander Header="纬纱成本:"  Name="zoneWFYarn">
                <DataGrid 
                        ItemsSource="{Binding Source={StaticResource vwWFPRICE}}" 
                        RowDetailsVisibilityMode="VisibleWhenSelected"
                        AutoGenerateColumns="False" 
                        Height="Auto" 
                        Width="Auto"
                    Name="dlgWFYARN"
                        HorizontalScrollBarVisibility="Auto"
                        VerticalScrollBarVisibility="Auto"
                        Tag="VAPRICE"
                        SelectionChanged="dlgMaster_SelectionChanged" 
                        MaxWidth="{Binding Path=Width, ElementName=gdwfc1}"
                        >
                        <DataGrid.Columns>
                        <DataGridTextColumn  Binding="{Binding Path=QUARTICLE}" Header="纱线" Width="120" />
                        <DataGridTextColumn  Binding="{Binding Path=QUVAR}" Header="var" Width="40" />
                            <DataGridTextColumn  Binding="{Binding Path=QUCOLOR}" Header="色号" Width="40" />
                            <DataGridTextColumn  Binding="{Binding Path=QUCPRICE}" Header="价格" Width="40" />
                            <DataGridTextColumn  Binding="{Binding Path=QPUOM}" Header="单位" Width="40" />
                            <DataGridTextColumn  Binding="{Binding Path=QUFQUANTITY}" Header="数量" Width="40" />
                            <DataGridTextColumn  Binding="{Binding Path=QUCVALUE}" Header="金额" Width="50" />
                            <DataGridTextColumn  Binding="{Binding Path=QUPRODCOST}" Header="加工成本" Width="60" />
                    </DataGrid.Columns>
                </DataGrid>
            </Expander>
   
            <WrapPanel>
            <TextBlock>加工成本:</TextBlock>
                <TextBox  Margin="10,0,0,0"  Background="Yellow" Text="{Binding Path=QUPRODCOST, Mode=TwoWay, Source={StaticResource vwVAPRICE}}" VerticalAlignment="Center" Width="60" />
            </WrapPanel>
            <DataGrid 
                ItemsSource="{Binding Source={StaticResource vwVAPRICE}}" 
                RowDetailsVisibilityMode="VisibleWhenSelected"
                AutoGenerateColumns="False" 
                Height="Auto" 
                Width="Auto"
                HorizontalScrollBarVisibility="Auto"
                VerticalScrollBarVisibility="Auto"
                Tag="VAPRICE"
                Name="dlgVAPRICE"
                SelectionChanged="dlgMaster_SelectionChanged" 
                >
                <DataGrid.Columns>
                    <DataGridTextColumn  Binding="{Binding Path=QUSTAGEDES}" Header="价格" Width="40" />
                    <DataGridTextColumn  Binding="{Binding Path=QPUOM}" Header="单位" Width="40" />
                    <DataGridTextColumn  Binding="{Binding Path=QUCVALUE}" Header="金额" Width="80" />
                    <DataGridTextColumn  Binding="{Binding Path=QUFQUANTITY}" Header="数量" Width="80" />
                    <DataGridTextColumn  Binding="{Binding Path=QUPRODCOST}" Header="加工成本" Width="80" />
                </DataGrid.Columns>
            </DataGrid> 
        </StackPanel>
        <StackPanel Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="3"  Grid.RowSpan="3">
            <WrapPanel Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="4">
                <Label Content="系统" Width="40" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0" Text="00" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="1" />
                <Label Content="语言" Width="40" Margin="0,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                <Label Content="用户名" Width="60" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                <Label Content="密码" Width="40" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow" FontSize="18" KeyboardNavigation.TabIndex="1" TabIndex="4" />
                <Button Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="34" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/User.png" />
                    </Button.Background>
                </Button>                
            </WrapPanel> 
            <WrapPanel>
                <Button  Margin="10,0,0,0" Name="btnReset" Click="btnReset_Click">重置</Button>
                <Button  Margin="10,0,0,0" Name="btnExProcess" Click="btnExProcess_Click">外加工费用</Button>
                <Button   Margin="10,0,0,0" Name="btnYarnPrice" Click="btnYarnPrice_Click">原纱价格</Button>
            </WrapPanel>
            <TabControl Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="4"> 
                <TabItem Header="供应商选择">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" Name="gdadr1"></RowDefinition>
                            <RowDefinition Height="1*" Name="gdadr2" MaxHeight="800"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"  Name="gdadc1"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <WrapPanel>
                            <Button Height="23" Margin="20,0,0,0"  Width="23"  Click="btnConfirm_Click"  Tag="RYARNPRICE" >
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Resources/Images/32x32/button_ok.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock>完成原纱指定</TextBlock>
                            <Button    
                                Height="23" 
                                Margin="20,0,0,0" 
                                Width="23"
                                Click="btnConfirm_Click"
                                   Tag="VAPRICE"
                                   >
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Resources/Images/32x32/button_ok.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock>确认各项成本</TextBlock>
                        </WrapPanel>
                        <StackPanel Grid.Row="1"  Grid.Column="0" Grid.ColumnSpan="1">
                            <Expander Name="zoneRawYarnSupplier" Header="供应商列表">
                                    <DataGrid 
                                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwRYARNPRICE}}"
                                        RowDetailsVisibilityMode="VisibleWhenSelected"
                                        AutoGenerateColumns="False" 
                                        Height="Auto" 
                                        MaxHeight="300"
                                        Width="Auto"
                                        HorizontalScrollBarVisibility="Auto"
                                        VerticalScrollBarVisibility="Auto"
                                        Name="dlgMATSupplier"
                                        SelectionChanged="dlgYarnPrice_SelectionChanged"
                                        >
                                <DataGrid.Columns>
                                    <DataGridTextColumn  Binding="{Binding Path=YSUPNAME}" Header="供应商" Width="120" />
                                    <DataGridTextColumn  Binding="{Binding Path=YYARN}" Header="品种" Width="120" />
                                    <DataGridTextColumn  Binding="{Binding Path=YVAR}" Header="var" Width="40" />
                                    <DataGridTextColumn  Binding="{Binding Path=YCOLOR}" Header="色号" Width="80" />
                                    <DataGridTextColumn  Binding="{Binding Path=YCPRICE}" Header="价格" Width="120" />
                                    <DataGridTextColumn  Binding="{Binding Path=YUOM}" Header="单位" Width="60" />
                                </DataGrid.Columns>
                            </DataGrid>
                            </Expander>
                            <DataGrid 
                                    ItemsSource="{Binding Source={StaticResource vwVAPROC}}" 
                                    Name="dlgVAPROC" 
                                    RowDetailsVisibilityMode="VisibleWhenSelected"
                                    AutoGenerateColumns="False" 
                                    Height="Auto" 
                                MaxHeight="300"
                                    Width="Auto"
                                    HorizontalScrollBarVisibility="Auto"
                                    VerticalScrollBarVisibility="Auto"
                                    Tag="VAPROC"
                                    SelectionChanged="dlgPROC_SelectionChanged"
                                    MaxWidth="{Binding Path=Width, ElementName=gdadc1}">
                                    <DataGrid.Columns>
                                    <DataGridTextColumn  Binding="{Binding Path=QPCPRICE}" Header="单价" Width="60" />
                                    <DataGridTextColumn  Binding="{Binding Path=QPUOM}" Header="单位" Width="40" />
                                    <DataGridTextColumn  Binding="{Binding Path=QPPROCDES}" Header="描述" Width="120" />
                                      <DataGridTextColumn  Binding="{Binding Path=QPSUPPLIER}" Header="供应商" Width="60" />
                                    <DataGridTextColumn  Binding="{Binding Path=QPPROCESS}" Header="加工" Width="80" />
                                </DataGrid.Columns>
                                </DataGrid>
                             <DataGrid
                                    ItemsSource="{Binding Source={StaticResource vwEXVAPROC}}"
                                    RowDetailsVisibilityMode="VisibleWhenSelected" 
                                    AutoGenerateColumns="False"
                                    Name="dlgEXVAPROC"
                                    Tag="EXVAPROC"
                                    SelectionChanged="dlgEXPROC_SelectionChanged"
                                    Height="Auto" 
                                 MaxHeight="300"
                                    Width="Auto" 
                                    HorizontalScrollBarVisibility="Auto"
                                    VerticalScrollBarVisibility="Auto"
                                    >
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Binding="{Binding Path=QCPRICE}" Header="单价" Width="60" />
                                        <DataGridTextColumn Binding="{Binding Path=QUOM}" Header="单位" Width="40" />
                                        <DataGridTextColumn Binding="{Binding Path=QFDESCRIPTION}" Header="描述" Width="120" />
                                        <DataGridTextColumn Binding="{Binding Path=QSUPNAME}" Header="供应商" Width="60" />
                                        <DataGridTextColumn Binding="{Binding Path=QPROCESS}" Header="加工" Width="40" />
                                    </DataGrid.Columns>
                                </DataGrid> 
                        </StackPanel>
                    </Grid>
                </TabItem>
                <TabItem Header="工艺信息">
                    <Grid DataContext="" Name="main"     Margin="10,10,0,0"    MaxWidth="{Binding Path=Width, ElementName=mainw}">
                        <Grid.RowDefinitions>
                            <RowDefinition   Height="Auto" />
                            <RowDefinition   Height="Auto" />
                            <RowDefinition  Height="100" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition Width="1*" />
                            <ColumnDefinition   Width="1*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
                            <Expander  Header="报价历史"  Name="zoneQuotation" ExpandDirection="Down" IsExpanded="True">
                                <StackPanel >
                                    <WrapPanel>
                                        <TextBox Name="txtQuotationART" Width="150" Text="{Binding Path=Text, ElementName=cmbWAART, Mode=OneWay}" ></TextBox>
                                        <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="cmdListQuotation" Click="cmdListQuotation_Click"
                                 KeyboardNavigation.TabIndex="3" IsDefault="True">
                                            <Button.Background>
                                                <ImageBrush ImageSource="/IntexReportClient;component/Images/Search.png" />
                                            </Button.Background>
                                        </Button>
                                    </WrapPanel>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Name="row21"  Height="Auto" MaxHeight="200" MinHeight="100"/>
                                            <RowDefinition  Name="row22" Height="Auto" />
                                            <RowDefinition Name="row23"  Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Name="colum21"  Width="1*" />
                                            <ColumnDefinition  Name="colum22" Width="1*" />
                                            <ColumnDefinition  Name="colum23" Width="1*" />
                                        </Grid.ColumnDefinitions>
                                        <StackPanel Grid.Row="0" Grid.Column="0" 
                                    MaxHeight="{Binding Path=Width, ElementName=row21}">
                                            <DataGrid 
                                AutoGenerateColumns="False"
                                Height="Auto"
                                HorizontalAlignment="Left" 
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwKAAUF}}" 
                                MaxHeight="{Binding Path=Width, ElementName=row21}"
                                MaxWidth="{Binding Path=Width, ElementName=colum21}"
                                Margin="0,0,0,0" 
                                Name="kAAUFDataGrid" 
                                RowDetailsVisibilityMode="VisibleWhenSelected"
                                VerticalAlignment="Top" >
                                                <DataGrid.Columns>
                                                    <DataGridTextColumn x:Name="kAAKANRColumn" Binding="{Binding Path=KAAKANR}" Header="KAAKANR" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAKAPOSColumn" Binding="{Binding Path=KAAKAPOS}" Header="KAAKAPOS" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAANEUBColumn" Binding="{Binding Path=KAANEUB}" Header="KAANEUB" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAANEUDColumn" Binding="{Binding Path=KAANEUD}" Header="KAANEUD" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVERFAColumn" Binding="{Binding Path=KAAVERFA}" Header="KAAVERFA" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAPSEUDOColumn" Binding="{Binding Path=KAAPSEUDO}" Header="KAAPSEUDO" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAURKANRColumn" Binding="{Binding Path=KAAURKANR}" Header="KAAURKANR" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAURKAPOSColumn" Binding="{Binding Path=KAAURKAPOS}" Header="KAAURKAPOS" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAZWECKColumn" Binding="{Binding Path=KAAZWECK}" Header="KAAZWECK" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVERColumn" Binding="{Binding Path=KAAVER}" Header="KAAVER" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAASTUFEColumn" Binding="{Binding Path=KAASTUFE}" Header="KAASTUFE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAPRTKZColumn" Binding="{Binding Path=KAAPRTKZ}" Header="KAAPRTKZ" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAASCHEMAColumn" Binding="{Binding Path=KAASCHEMA}" Header="KAASCHEMA" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAASVZLColumn" Binding="{Binding Path=KAASVZL}" Header="KAASVZL" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAKZWECKColumn" Binding="{Binding Path=KAAKZWECK}" Header="KAAKZWECK" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAKZWVERColumn" Binding="{Binding Path=KAAKZWVER}" Header="KAAKZWVER" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAKZWVZLColumn" Binding="{Binding Path=KAAKZWVZL}" Header="KAAKZWVZL" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAFREZKZColumn" Binding="{Binding Path=KAAFREZKZ}" Header="KAAFREZKZ" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAADREZKZColumn" Binding="{Binding Path=KAADREZKZ}" Header="KAADREZKZ" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAABREZKZColumn" Binding="{Binding Path=KAABREZKZ}" Header="KAABREZKZ" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVWKZColumn" Binding="{Binding Path=KAAVWKZ}" Header="KAAVWKZ" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVWKANRColumn" Binding="{Binding Path=KAAVWKANR}" Header="KAAVWKANR" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVWKAPOSColumn" Binding="{Binding Path=KAAVWKAPOS}" Header="KAAVWKAPOS" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAAKTKZColumn" Binding="{Binding Path=KAAAKTKZ}" Header="KAAAKTKZ" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAKZSTDColumn" Binding="{Binding Path=KAAKZSTD}" Header="KAAKZSTD" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAAUFKRSColumn" Binding="{Binding Path=KAAAUFKRS}" Header="KAAAUFKRS" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAAUFLFDColumn" Binding="{Binding Path=KAAAUFLFD}" Header="KAAAUFLFD" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAAUFPOSColumn" Binding="{Binding Path=KAAAUFPOS}" Header="KAAAUFPOS" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAKAKUNDNRColumn" Binding="{Binding Path=KAAKAKUNDNR}" Header="KAAKAKUNDNR" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAASCHBRTColumn" Binding="{Binding Path=KAASCHBRT}" Header="KAASCHBRT" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAASCHLGColumn" Binding="{Binding Path=KAASCHLG}" Header="KAASCHLG" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAWRIColumn" Binding="{Binding Path=KAAWRI}" Header="KAAWRI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAALANDIColumn" Binding="{Binding Path=KAALANDI}" Header="KAALANDI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAWREColumn" Binding="{Binding Path=KAAWRE}" Header="KAAWRE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAALANDEColumn" Binding="{Binding Path=KAALANDE}" Header="KAALANDE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVERPZIColumn" Binding="{Binding Path=KAAVERPZI}" Header="KAAVERPZI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVERPZEColumn" Binding="{Binding Path=KAAVERPZE}" Header="KAAVERPZE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVERSZIColumn" Binding="{Binding Path=KAAVERSZI}" Header="KAAVERSZI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAVERSZEColumn" Binding="{Binding Path=KAAVERSZE}" Header="KAAVERSZE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAFRAZIColumn" Binding="{Binding Path=KAAFRAZI}" Header="KAAFRAZI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAFRAZEColumn" Binding="{Binding Path=KAAFRAZE}" Header="KAAFRAZE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAZOLLZIColumn" Binding="{Binding Path=KAAZOLLZI}" Header="KAAZOLLZI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAZOLLZEColumn" Binding="{Binding Path=KAAZOLLZE}" Header="KAAZOLLZE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAPROVZIColumn" Binding="{Binding Path=KAAPROVZI}" Header="KAAPROVZI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAAPROVZEColumn" Binding="{Binding Path=KAAPROVZE}" Header="KAAPROVZE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAABONZIColumn" Binding="{Binding Path=KAABONZI}" Header="KAABONZI" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAABONZEColumn" Binding="{Binding Path=KAABONZE}" Header="KAABONZE" Width="SizeToHeader" />
                                                    <DataGridTextColumn x:Name="kAASKTZIColumn" Binding="{Binding Path=KAASKTZI}" Header="KAASKTZI" Width="SizeToHeader" />
                                                </DataGrid.Columns>
                                            </DataGrid>
                                        </StackPanel>
                                    </Grid>
                                </StackPanel>
                            </Expander>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3">
                            <Expander  Name="znWS" Header="技术数据" ExpandDirection="Down" IsExpanded="True" MaxWidth="1000" HorizontalAlignment="Left">
                                <StackPanel  DataContext="{Binding Source={StaticResource ResourceKey=vwWASTAMM}}">
                                    <StackPanel >
                                        <WrapPanel >
                                            <TextBlock >坯布信息:</TextBlock>
                                            <Grid  Margin="0,0,0,0">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition  Width="1*" />
                                                    <ColumnDefinition Width="1*" />
                                                </Grid.ColumnDefinitions>
                                                <Label Content="经密:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-2,3,0,3" />
                                                <TextBox Grid.Column="1" Text="{Binding Path=WARFDDIK, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                                            </Grid>
                                            <Grid  >
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition  Width="1*" />
                                                    <ColumnDefinition  Width="1*" />
                                                </Grid.ColumnDefinitions>
                                                <Label  Content="下机纬密:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                <TextBox   Grid.Column="1" Text="{Binding Path=WARFDDIS, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                                            </Grid>

                                        </WrapPanel>
                                        <WrapPanel>
                                            <TextBlock  >工艺信息:</TextBlock>
                                            <Grid   Margin="20,0,0,0">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition   Width="1*" />
                                                    <ColumnDefinition   Width="1*" />
                                                </Grid.ColumnDefinitions>
                                                <Label  Content="机上纬密:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-3,3,0,3" />
                                                <TextBox  Grid.Column="1" Text="{Binding Path=WTGFDISM, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwWTGEW}}" VerticalAlignment="Center" Width="60" />
                                            </Grid>
                                            <Grid   Margin="10,0,0,0">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition   Width="1*" />
                                                    <ColumnDefinition   Width="1*" />
                                                </Grid.ColumnDefinitions>
                                                <Label  Content="引纬纱长:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                                <TextBox   Grid.Column="1" Text="{Binding Path=WTGFDLGS, Mode=TwoWay,  Converter={StaticResource ResourceKey=d10}, Source={StaticResource ResourceKey=vwWTGEW}}" VerticalAlignment="Center" Width="60" />
                                            </Grid>
                                        </WrapPanel>
                                    </StackPanel>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"></RowDefinition>
                                            <RowDefinition Height="Auto"></RowDefinition>
                                            <RowDefinition Height="Auto"></RowDefinition>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="440"></ColumnDefinition>
                                            <ColumnDefinition Width="20"></ColumnDefinition>
                                            <ColumnDefinition Width="440"></ColumnDefinition>
                                        </Grid.ColumnDefinitions>
                                        <WrapPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" >
                                            <TextBlock>经轴信息:</TextBlock>
                                            <Grid   Margin="20,0,0,0">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition   Width="1*" />
                                                    <ColumnDefinition   Width="1*" />
                                                </Grid.ColumnDefinitions>
                                                <Label  Content="系数:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-3,3,0,3" />
                                                <TextBox  Grid.Column="1" Text="{Binding Path=WAKEAFAKTR, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwWASTKE}}" VerticalAlignment="Center" Width="60" />
                                            </Grid>
                                        </WrapPanel>
                                    </Grid>
                                </StackPanel>
                            </Expander>
                            <Expander Name="znBS" Header="用纱信息" ExpandDirection="Down" IsExpanded="True">
                                <Grid >
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"></RowDefinition>
                                        <RowDefinition Height="Auto"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition  Width="500" />
                                        <ColumnDefinition   Width="40" />
                                        <ColumnDefinition  Width="500" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="1"  >经纱信息</TextBlock>
                                    <TextBlock Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="1"  >纬纱信息</TextBlock>
                                    <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1"  >
                                        <DataGrid AutoGenerateColumns="False" 
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwBASTGA}}"
                              HeadersVisibility="Column" 
                              x:Name="dlgBBASTGA"
                              CanUserReorderColumns="True" 
                              CanUserResizeRows="True"
                              CanUserSortColumns="True"
                              RowDetailsVisibilityMode="VisibleWhenSelected" 
                              Width="Auto" Height="Auto" 
                              EnableColumnVirtualization="True" 
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" >
                                            <DataGrid.Columns>
                                                <DataGridTextColumn  Binding="{Binding Path=BAGPOS}" Header="行" Width="Auto" MinWidth="30" />
                                                <DataGridTextColumn  Binding="{Binding Path=BAGGART}" Header="纱线" Width="Auto" MinWidth="120" />
                                                <DataGridTextColumn  Binding="{Binding Path=BAGGVAR}" Header="版本" Width="Auto" MinWidth="30" />
                                                <DataGridTextColumn  Binding="{Binding Path=BAGFDZ}" Header="根数" Width="Auto" MinWidth="40" />
                                                <DataGridTextColumn  Binding="{Binding Path=BAGABF, Converter={StaticResource ResourceKey=d10}}" Header="损耗" Width="Auto" MinWidth="40" />
                                                <DataGridTextColumn  Binding="{Binding Path=BAGKGNET, Converter={StaticResource ResourceKey=d1000}}" Header="净重" Width="Auto" MinWidth="60" />
                                                <DataGridTextColumn  Binding="{Binding Path=BAGKGBRUT, Converter={StaticResource ResourceKey=d1000}}" Header="总重" Width="Auto" MinWidth="60" />
                                            </DataGrid.Columns>
                                        </DataGrid>
                                        <WrapPanel DataContext="{Binding Source={StaticResource ResourceKey=vwBASTGA}}">
                                            <Label Content="行号:" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBlock Background="LightGray" Text="{Binding Path=BAGPOS, Mode=TwoWay}" VerticalAlignment="Center" Width="40" />
                                            <Label  Content="头份:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox   Background="White" Text="{Binding Path=BAGFDZ, Mode=TwoWay}" VerticalAlignment="Center" Width="60" />
                                            <Label  Content="纱线:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox  Name="txtGART" Background="White" Text="{Binding Path=BAGGART, Mode=TwoWay}" VerticalAlignment="Center" Width="180" />
                                            <TextBox  Name="txtGVAR" Background="AliceBlue" Text="{Binding Path=BAGGVAR, Mode=TwoWay}" VerticalAlignment="Center" Width="40" />
                                        </WrapPanel>
                                        <WrapPanel  DataContext="{Binding Source={StaticResource ResourceKey=vwBASTGA}}">
                                            <Label Content="损耗:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox Name="txtGFARBE" Background="White" Text="{Binding Path=BAGABF, Mode=TwoWay, Converter={StaticResource ResourceKey=d10}}" VerticalAlignment="Center" Width="40" />
                                            <Label Content="净用量:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox Name="txtBAGKGNET" Background="White" Text="{Binding Path=BAGKGNET, Mode=TwoWay, Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="80" />
                                            <Label Content="总用量:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox Name="txtBAGKGBRUT" Background="White" 
                                         Text="{Binding Path=BAGKGBRUT, Mode=TwoWay, Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="80" />
                                        </WrapPanel>
                                        <TextBlock >经纱汇总信息：</TextBlock>
                                        <DataGrid  AutoGenerateColumns="False"  ItemsSource="{Binding}" HeadersVisibility="Column" x:Name="dlgSumBASTGA" 
                                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" MinHeight="80" MaxHeight="200">
                                            <DataGrid.Columns>
                                                <DataGridTextColumn Binding="{Binding Path=BAGGART}" Header="纱线" Width="160" />
                                                <DataGridTextColumn Binding="{Binding Path=BAGGVAR}" Header="版本" Width="40" />
                                                <DataGridTextColumn Binding="{Binding Path=sumBAGKGNET}" Header="净重" Width="60" />
                                                <DataGridTextColumn Binding="{Binding Path=sumBAGKGBRUT}" Header="总重" Width="60" />
                                                <DataGridTextColumn Binding="{Binding Path=sumBAGFDZ}" Header="总根数" Width="60" />
                                                <DataGridTextColumn Binding="{Binding Path=sumBeam}" Header="轴数" Width="40" />
                                            </DataGrid.Columns>
                                        </DataGrid>
                                    </StackPanel>
                                    <StackPanel Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="1"  >
                                        <DataGrid Grid.Column="0" AutoGenerateColumns="False"  ItemsSource="{Binding Source={StaticResource ResourceKey=vwWASTGA}}" HeadersVisibility="Column" x:Name="dlgWASTGA" CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                                      RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True"  ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                                            <DataGrid.Columns>
                                                <DataGridTextColumn Binding="{Binding Path=WAGPOS}" Header="行" Width="Auto" MinWidth="40" />
                                                <DataGridTextColumn Binding="{Binding Path=WAGGART}" Header="纱线" Width="Auto" MinWidth="160" />
                                                <DataGridTextColumn Binding="{Binding Path=WAGGVAR}" Header="版本" Width="Auto" MinWidth="40" />
                                                <DataGridTextColumn Binding="{Binding Path=WAGFDZ}" Header="根数" Width="Auto" MinWidth="40" />
                                                <DataGridTextColumn Binding="{Binding Path=WAGABF,  Converter={StaticResource ResourceKey=d10}}" Header="损耗" Width="Auto" MinWidth="40" />
                                                <DataGridTextColumn Binding="{Binding Path=WAGKGNET, Converter={StaticResource ResourceKey=d1000}}" Header="净重" Width="Auto" MinWidth="40" />
                                                <DataGridTextColumn Binding="{Binding Path=WAGKGBRUT,  Converter={StaticResource ResourceKey=d1000}}" Header="总重" Width="Auto" MinWidth="40" />
                                            </DataGrid.Columns>
                                        </DataGrid>
                                        <WrapPanel DataContext="{Binding Source={StaticResource ResourceKey=vwWASTGA}}">
                                            <Label Content="行号:" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBlock  Background="LightGray" Text="{Binding Path=WAGPOS, Mode=TwoWay}" VerticalAlignment="Center" Width="40" />
                                            <Label  Content="头份:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox Background="White" Text="{Binding Path=WAGFDZ, Mode=TwoWay}" VerticalAlignment="Center" Width="60" />
                                            <Label  Content="纱线:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox  Name="txtFGART" Background="White" Text="{Binding Path=WAGGART, Mode=TwoWay}" VerticalAlignment="Center" Width="180" />
                                            <TextBox Name="txtFGVAR" Background="AliceBlue" Text="{Binding Path=WAGGVAR, Mode=TwoWay}" VerticalAlignment="Center" Width="40" />
                                        </WrapPanel>
                                        <WrapPanel  DataContext="{Binding Source={StaticResource ResourceKey=vwWASTGA}}">
                                            <Label  Content="损耗:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox Background="White" Text="{Binding Path=WAGABF, Mode=TwoWay, Converter={StaticResource ResourceKey=d10}}" VerticalAlignment="Center" Width="40" />
                                            <Label  Content="净用量:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox  Name="txtWAGKGNET" Background="White" Text="{Binding Path=WAGKGNET, Mode=TwoWay, Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="80" />
                                            <Label  Content="总用量:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                            <TextBox Name="txtWAGKGBRUT" Background="White" Text="{Binding Path=WAGKGBRUT, Mode=TwoWay, Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="80" />
                                            <TextBlock >/每100米坯布</TextBlock>
                                        </WrapPanel>
                                    </StackPanel>
                                </Grid>
                            </Expander>
                        </StackPanel>
                    </Grid>
                </TabItem>
            </TabControl>
        </StackPanel> 
    </Grid>
</local:DocumentBase>
